{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "0c669499",
   "metadata": {},
   "source": [
    "### 本周学习目标\n",
    "#### 1.课本代码（项目1，从奇数中选择对应的时间节点）\n",
    "#### 2.认识变量\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "94f9d5aa",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 从pythin基础库中找到datetime模块\n",
    "from datetime import datetime"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "9a708dfe",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "datetime.datetime(2021, 9, 10, 20, 29, 1, 423577)"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "datetime.today()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "3c2e4774",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "时间是奇数，时间在odds数据中\n"
     ]
    }
   ],
   "source": [
    "# 课本代码(项目一，从奇数中选择对应的时间节点)\n",
    "odds = [1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,57,59,]\n",
    "\n",
    "right_this_minute = datetime.today().minute\n",
    "\n",
    "if right_this_minute in odds:\n",
    "    print(\"时间是奇数，时间在odds数据中\")\n",
    "else:\n",
    "    print(\"Not an odd minute.\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "d2cc9974",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1631277041.205905"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import time\n",
    "time.time()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "9a1db440",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "26"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 认识变量\n",
    "wait_time"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "7c2f5570",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "1+1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "2c5db761",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "9.5"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "95/10"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "77f1558b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'eggs'"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "'eggs'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "bacddf7a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'sean'"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "'sean'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "86ae9b63",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'yibo'"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "'yibo'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "fca7cc6e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "95"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "age_a = 90\n",
    "\n",
    "age_a+5"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "id": "5e457ea9",
   "metadata": {},
   "outputs": [
    {
     "ename": "IndentationError",
     "evalue": "unindent does not match any outer indentation level (<tokenize>, line 8)",
     "output_type": "error",
     "traceback": [
      "\u001b[1;36m  File \u001b[1;32m\"<tokenize>\"\u001b[1;36m, line \u001b[1;32m8\u001b[0m\n\u001b[1;33m    else:\u001b[0m\n\u001b[1;37m    ^\u001b[0m\n\u001b[1;31mIndentationError\u001b[0m\u001b[1;31m:\u001b[0m unindent does not match any outer indentation level\n"
     ]
    }
   ],
   "source": [
    "# if else\n",
    "\n",
    "if today == \"Saturday\":\n",
    "     print(\"Happy!\")\n",
    "elif today == \"Sunday\":\n",
    "     if condition == \"Boring\":\n",
    "        print(\"Recover, then rest.\")\n",
    "    else:\n",
    "          print(\"Rest.\")\n",
    "    else:\n",
    "         print(\"Study, study, study.\")\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "15a6d8b0",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
